<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function some(element, arr) {
            let result
            for (let i = 0; i < arr.length; i++) {
                if (element === arr[i]) {
                    result = arr[i]
                    break
                }
            }
            if (Boolean(result)) {
                return `存在`
            }
            else {
                return `不存在`
            }
        }
        let arr = []
        while (true) {
            let data = prompt(`请输入一个数组并按Enter结束`)
            if (!Boolean(data)) {
                break
            }
            arr.push(data)
        }
        alert(arr)
        let element = prompt(`请输入要查找的元素`)

        let re = some(element, arr)
        document.write(re)
    </script>
</body>

</html>